<template>
  <v-container class="align-center justify-center">
    <v-card-text class="align-center justify-center">
      <NuxtImg :src="imgSrc"/>
    </v-card-text>
    <v-card-actions class="align-center justify-center">
      <v-btn @click="homepage()"> {{ $t('button.common.homepage') }}</v-btn>
    </v-card-actions>
  </v-container>
</template>
<script setup lang="ts">
import {LAYOUT_DEFAULT, ROUTE_INDEX, TITLE_MAIN} from "~/resource/constants/common/constant";
definePageMeta({
  layout: LAYOUT_DEFAULT,
  title: TITLE_MAIN,
})
const local = useLocale();
const imgSrc = ref<string>('');
const error = useError();
const homepage = () => {
  navigateTo(ROUTE_INDEX)
}
const initImg = () => {
  if (error.value?.statusCode === 404) {
    imgSrc.value = local.t('image.404');
  } else {
    imgSrc.value = local.t('image.405');
  }
}
initImg();
</script>